<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
</head>
<body>
<h2>Home</h2>
<hr>
<p>姓名：{{ name }}</p>
<p>年龄：{{ age }}</p>
<p>兴趣爱好：｛｛ likes ｝｝</p>
<p>
    兴趣爱好：
    {% for like in likes %}
        {{ like }},
    {% endfor %}
</p>

<hr>
<h4>标签</h4>
<h5>if语句</h5>
{% if age >= 18 %}
    <p>{{ name }} 已经成年</p>
{% else %}
    <p>｛｛ name ｝｝ 未成年</p>
{% endif %}


<h5>for循环</h5>
{% for like in likes %}

    {% if loop.first %}
        <p style="color: red;">{{ like }}</p>
    {% elif loop.last %}
        <p style="color: blue">{{ like }}</p>
    {% else %}
        <p>{{ like }}</p>
    {% endif %}

    index: {{ loop.index }},
    index0 {{ loop.index0 }},
    revindex: {{ loop.revindex }},
    revindex0: {{ loop.revindex0 }},

{% else %}
    <b>else</b>
{% endfor %}


</body>
</html>